package chapter23.homework02;

public class Player {
    private String name;
    private State state;
    public State getState() {
        return state;
    }

    public void setState(State state) {
        this.state = state;
    }

    public String getName(){
      return this.name;
  }

  public void setName(String name){
      this.name = name;
  }

  public Player(String name){
        this.name = name;
        this.state = new Primary(this);//传入玩家的初始状态
  }
  public void playWin(){
      state.playWin();
  }
  public void playLose(){
        state.playLose();
  }
  public void doubleScore(){
        state.doubleScore();
  }
  public void changeCards(){
        state.changeCards();
  }
  public void peekCards(){
        state.peekCard();
  }
}